/**
 * @autor Carlos E. AgÃ¼ero
 *
 * GSyC 2008/2009
 * 
 */
package Flight;

import java.util.*;
import java.io.*;

public abstract class Flight implements Comparable<Object>, Serializable{


	private static final long serialVersionUID = 1L;
	protected Calendar departureTime, arrivalTime;
	protected String flightNumber, source, destination, status;
	private static BufferedReader br;
	
	
	public Flight (Calendar depTime, Calendar arrTime, String number,
			String src, String dst, String st){
	
		departureTime = (Calendar)depTime.clone();
		arrivalTime = (Calendar)arrTime.clone();
		flightNumber = new String(number);
		source = new String(src);
		destination = new String(dst);
		status = new String(st);
		
		br = new BufferedReader(new InputStreamReader(System.in));
	}
	
	public Calendar getDepartureTime() {return (Calendar)departureTime.clone();}
	public Calendar getArrivalTime() {return (Calendar)arrivalTime.clone();}
	public String getFlightNumber() {return flightNumber;}
	public String getDestination() {return destination;}
	public String getSource() {return source;}
	public String getStatus() {return status;}
	
	public void setState(String st) {
		status = st;
	}
	
	public void setFlightNumber(String newNumber) {
		flightNumber = newNumber;
	}
	
	public void editStatus()  throws IOException{
		String newStatus;

		newStatus = fillData("Introduzca el estado del vuelo");
		setState(newStatus);
	}
	
	public static String fillData(String info) throws IOException{
		br = new BufferedReader(new InputStreamReader(System.in));
		clrScreen();
		System.out.println(info);
		return br.readLine();
	}
	
	private static void clrScreen(){
		for (int i = 0; i < 80; i++)
			System.out.println();
	}
	
	public abstract int compareTo(Object arg0);

}